package com.intcast;

import java.util.Scanner;

/*
要写注释哦!!!
*/
public class Demo06 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一四个密码：");
        int pasword = sc.nextInt();
        int[] arr = {(pasword / 1000) % 10, (pasword / 100) % 10, (pasword / 10) % 10, (pasword % 10)};
        addPassword(arr);
        revers(arr);
        int sum = 0;
        int chu = 1000;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i] * chu;
            chu /= 10;
        }
        System.out.println(sum);
    }

    public static void addPassword(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            arr[i] += 5;
        }
    }

    public static void revers(int[] arr) {
        for (int i = 0; i < arr.length / 2; i++) {
            int temp = arr[i];
            arr[i] = arr[arr.length - 1 - i];
            arr[arr.length - 1 - i] = temp;
        }
    }
}
